package bairui.international.console.web.controller.login.manager;

/**
 * @see bairui.international.console.web.controller.login.manager.Page_BaseFilter
 *
 */
class Page_Filter

{
	
	/**
	 * 过滤扩展接口
	 */
	static interface FilterExtends {
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		com.lianjing.sh.project.authority.model.domain.jpa.QTB_LoginRecord QRoot,
		javax.servlet.http.HttpServletRequest request
	) {
		com.querydsl.core.BooleanBuilder query = query(
				QRoot
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("user"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("addr"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("createTime_start"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					),
				com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("createTime_end"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					)
			);
			/* comment 附加过滤属性 */
	;
		return query;
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		com.lianjing.sh.project.authority.model.domain.jpa.QTB_LoginRecord QRoot
	,	String user
	,	String addr
	,	java.util.Date createTime_start,
		java.util.Date createTime_end
	) {
		com.querydsl.core.BooleanBuilder builder = new com.querydsl.core.BooleanBuilder();
	
		if(null != user){
			builder.and(QRoot.user.like("%"+user+"%"));
		}
		if(null != addr){
			builder.and(QRoot.addr.like("%"+addr+"%"));
		}
		if(null != createTime_start && null != createTime_end){
			builder.and(QRoot.createTime.between(createTime_start, createTime_end));
		}
		return builder;
	}
	
}
